# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-data-validate-ip
_pkgname=Data-Validate-IP
pkgver=0.31
pkgrel=3
pkgdesc='IPv4 and IPv6 validation methods'
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl' 'perl-netaddr-ip')
url='https://metacpan.org/release/Data-Validate-IP'
source=("https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/$_pkgname-$pkgver.tar.gz")
sha512sums=('22ea6a8673fa07d405cb2f8645bd019265abf4104057c73d0399951a837549cedb97737f50b2e9e605202679c85ae5a7b7a24dd8d9fd8736624551b0b41fd6d8')
_distdir="$_pkgname-$pkgver"

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB="" \
      PERL_AUTOINSTALL=--skipdeps \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
      PERL_MB_OPT="--insalldirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    cd $_distdir

    /usr/bin/perl Makefile.PL

    make
  )
}

package() {
  cd $_distdir

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

